Skip to content

theryangeary/choose

choose:类似于 cutawk 的工具,但是更易用和更强大。choosecut 命令的替代品,用来显示行中的指定部分,删除文件中指定字段。cut 经常用来显示文件的内容,类似于 type 命令。

它的优势主要是语法更简单,比如输出文件的第一列。

bash
# cut 的写法
$ cat data.txt | cut -d " " -f 1
# or
$ cut -d " " -f 1 data.txt

# choose 的写法
$ cat data.txt | choose 0
# or
$ choose 0 -i data.txt